<template>
  <div class="component-basic-info">
    <!-- 店铺审核状态 -->
    <div class="audit-status">
      <div class="audit-item">
        <span class="week">{{ $t('shop.storeStatus') }}：</span>
        <span v-if="dataForm.shopStatus === -1">{{ $t('shop.nonactivated') }}</span>
        <span v-if="dataForm.shopStatus === 0">{{ $t('shop.closed') }}</span>
        <span v-if="dataForm.shopStatus === 1">{{ $t('shop.inOperation') }}</span>
        <span v-if="dataForm.shopStatus === 2">{{ $t('groups.offlineViolation') }}</span>
        <span v-if="dataForm.shopStatus === 3">{{ $t('productComm.platformAudit') }}</span>
      </div>
    </div>
    <div class="business-info-mod">
      <el-form
        ref="dataFormRef"
        v-loading="pageLoading"
        label-width="140px"
        :model="dataForm"
        @submit.prevent
      >
        <div class="ci-wrapper">
          <div class="right-wrap">
            <el-form-item
              :label="$t('shop.shopLogo')+'：'"
              required
            >
              <div class="business-license-box">
                <div class="logo-image-box">
                  <img-show
                    v-if="dataForm.shopLogo"
                    class="logo-image"
                    :src="dataForm.shopLogo"
                  />
                </div>
              </div>
            </el-form-item>
          </div>
          <div class="left-wrap">
            <el-form-item
              :label="$t('shop.storeName')+'：'"
              required
            >
              {{ dataForm.shopName }}
            </el-form-item>
            <el-form-item
              :label="$t('shop.contactTel')+'：'"
              required
            >
              {{ dataForm.tel }}
            </el-form-item>
            <el-form-item
              :label="$t('shop.receiveSMSMobile')+'：'"
              required
            >
              {{ dataForm.receiveMobile }}
            </el-form-item>
            <el-form-item
              :label="$t('shop.shopDescription')+'：'"
            >
              <span
                v-if="dataForm.intro"
                class="intro"
              > {{ dataForm.intro }} </span>
              <span
                v-else
                class="noyet-wrap"
              >{{ $t('order.notYet') }}</span>
            </el-form-item>
          </div>
        </div>
      </el-form>
    </div>

    <div class="footer">
      <div class="foot-box">
        <el-button
          type="primary"
          @click="modifyBasicInfor"
        >
          {{ $t('distribution.update') }}
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
onMounted(() => {
  init()
})
const dataForm = ref({})
const init = () => {
  http({
    url: http.adornUrl('/shop/shopDetail/info'),
    method: 'get',
    params: http.adornParams()
  })
    .then(({ data }) => {
      dataForm.value = data
    })
}

const emit = defineEmits(['closeBrowse'])
/**
 * 修改
 */
const modifyBasicInfor = () => {
  emit('closeBrowse')
}
</script>

<style lang="scss" scoped>
@use "index";
</style>
